Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docker): add web, control-center in docker-compose #4190

Closed
wants to merge 2 commits into from
Closed

build(docker): add web, control-center in docker-compose #4190

wants to merge 2 commits into from

Conversation

Dhanus3133
Copy link

Added hyperswitch-web and hyperswitch-control-center in docker-compose

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Two new services were added to start the SDK, demo, and control center automatically within docker-compose.

Solves #4110

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

@Dhanus3133 Dhanus3133 requested review from a team as code owners March 26, 2024 04:33
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @Dhanus3133!

Also, how is the user expected to configure the publishable and API keys, and the remaining URLs?

docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@SanchithHegde SanchithHegde added A-infra Area: Infrastructure C-feature Category: Feature request or enhancement S-waiting-on-author Status: This PR is incomplete or needs to address review comments hiring-challenge labels Mar 26, 2024
@Dhanus3133
Copy link
Author

Thanks for the PR, @Dhanus3133!

Also, how is the user expected to configure the publishable and API keys, and the remaining URLs?

image

Resolved it.

@Dhanus3133
Copy link
Author

I noticed that one of the PRs closely mirrors mine. Just wanted to bring this matter to your attention.

Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you been able to test this out locally, and verified that the demo app loads correctly?

Comment on lines +135 to +136
env_file:
- ./.env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide an example of what this .env file would contain? Including placeholder values should be good enough.

@Dhanus3133
Copy link
Author

@SanchithHegde do you know why this happens?
image

@SanchithHegde
Copy link
Member

@SanchithHegde do you know why this happens?

If you're running the web client and demo app within a Docker container, and use localhost:8080 as server URL, the web client / demo app would try to access a service running at port 8080 within the container itself, not on the host machine. You'd need to understand the intricacies of Docker networking, and then go with a suitable, clean approach for solving this.

Comment on lines +154 to +155
- apiBaseUrl=http://hyperswitch-server:8080
- sdkBaseUrl=http://hyperswitch-web:9050
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work since the communication is initiated via browser here and not via the docker container

EXPOSE 5252
EXPOSE 9060

CMD concurrently "npm run start:dev" "npm run start:playground"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this npm command has been removed sometime ago here.

Comment on lines +9 to +10
RUN sed -i '/hot: true,/a \ host: "0.0.0.0",' webpack.dev.js
RUN sed -i '/hot: true,/a \ host: "0.0.0.0",' Hyperswitch-React-Demo-App/webpack.dev.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might not be needed since after this.

Comment on lines +157 to +158
hyperswitch-server:
condition: service_started
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhanus3133 can you remove this since we want the option to run this along with local server.
i.e using the local cargo run along with docker services for hyperswitch-web & hyperswitch-control-center.

Comment on lines +143 to +145
depends_on:
hyperswitch-server:
condition: service_started
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhanus3133 can you remove this since we want the option to run this along with local server.
i.e using the local cargo run along with docker services for hyperswitch-web & hyperswitch-control-center.

- router_net
environment:
- apiBaseUrl=http://hyperswitch-server:8080
- sdkBaseUrl=http://hyperswitch-web:9050
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdkBaseUrl should point to the js assets, in this case it would be sdkBaseUrl=http://<SDK_SERVICE>/HyperLoader.js

@Dhanus3133 Dhanus3133 closed this May 4, 2024
@Dhanus3133 Dhanus3133 deleted the docker-compose branch May 4, 2024 03:47
@SanchithHegde SanchithHegde removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infra Area: Infrastructure C-feature Category: Feature request or enhancement hiring-challenge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants